package Main;

import Course.Adm_Course_View;
import Student.Adm_Student_View;
import Teacher.Adm_Teacher_View;
import User.Adm_User_View;

import java.util.Scanner;

public class AdmView {
    // 显示操作菜单
    public static void displayMenu() {
        System.out.println("\n=========================================");
        System.out.println("            管理员界面");
        System.out.println("=========================================");
        System.out.println("请选择操作：");
        System.out.println("1. 学生信息管理");
        System.out.println("2. 教师信息管理");
        System.out.println("3. 课程信息管理");
        System.out.println("4. 用户信息管理");
        System.out.println("5. 退出");
        System.out.println("=========================================");
    }


    public static void control() throws Exception {
        Scanner scanner = new Scanner(System.in);
        boolean running = true;

        while (running) {

            displayMenu();

            System.out.print("请输入您的选择: ");
            int choice = scanner.nextInt();

            scanner.nextLine();

            switch (choice) {
                case 1:
                    Adm_Student_View.student();
                    break;
                case 2:
                    Adm_Teacher_View.Teacher();
                    break;
                case 3:
                    Adm_Course_View.course();
                    break;
                case 4:
                    Adm_User_View.User();
                    break;
                case 5:
                    System.out.println("\n=========================================");
                    System.out.println("正在返回主界面...");
                    System.out.println("=========================================");
                    running = false;  // 退出学生界面，返回到主界面
                    break;
                default:
                    System.out.println("\n输入无效，请重新选择！");
                    break;
            }
        }

    }
}
